from pptx import Presentation
from pptx.util import Inches

img_path = 'maishu.jpg'

prs = Presentation()
blank_slide_layout = prs.slide_layouts[6]
slide = prs.slides.add_slide(blank_slide_layout)

left = top = Inches(1)
# 在左上角添加1张图片，使用图片默认大小
pic = slide.shapes.add_picture(img_path, left, top)

# 在指定位置添加一张图片，指定图片高度为4.5英寸
left = Inches(5)
height = Inches(4.5)
pic = slide.shapes.add_picture(img_path, left, top, height=height)

prs.save('7.1.5.pptx')
